{% extends "default.html" %}
{% load i18n %}

{% block title %}
{% if update %}
{% trans "Edit" %} {% trans "Ad" %}
{% else %}
{% trans "Register New Ad" %}
{% endif %} 
{% endblock %}

{% block page_content %}

{% if error %}
<div style="color: red;">
{{ error }}
</div>
{% endif %}

<form
	{% if update %} 
	action="/ads/update/{{ object_id }}/" 
	{% else %}
	action="/ads/register/" 
	{% endif %}
	method="post">

{% for field in form %}
<div class="form_field_wrapper">
<span class="form_field_error">
{{ field.errors }}
</span>
<div class="form_field_input">
{{ field.label_tag }} : {{ field }}
</div>
</div>
{% endfor %}

<p><input type="submit" value='{% trans "Save" %}' /></p>
</form>
{% endblock page_content %}
